import request from '@/utils/request'

//层级显示subject
export function tslist(query) {
  return request({
    url: '/api/subject/tslist',
    method: 'get',
    params: query
  })
}

//层级显示subject
export function testlist(query) {
  return request({
    url: '/api/subject/test/tslist',
    method: 'get',
    params: query
  })
}

// 查询配方管理列表
export function list(query) {
    return request({
      url: '/api/ingredient/subject_test/list1',
      method: 'get',
      params: query
    })
  }

// listSubject
export function listSubject(query) {
  return request({
    url: '/api/subject/list',
    method: 'get',
    params: query
  })
}

// listTest
export function listTest(query) {
  return request({
    url: '/api/test/list',
    method: 'get',
    params: query
  })
}

// 新增原料信息管理
export function addmark(data) {
    return request({
      url: '/api/ingredient/subject_test',
      method: 'post',
      data: data
    })
  }

// 对比Ingredient
export function comparisonIngredient(data) {
  return request({
    url: '/api/ingredient/comparisonIngredient',
    method: 'post',
    data: data
  })
}

// 检查subject
export function importIngredientInfoCheck(data) {
  return request({
    url: '/api/importIngredientInfoCheck',
    method: 'post',
    data: data
  })
}

// 导入Subject
export function importIngredientInfoSave(data) {
  return request({
    url: '/api/importIngredientInfoSave',
    method: 'post',
    data: data
  })
}


// 修改原料信息管理
export function editmark(data) {
    return request({
      url: '/api/ingredient/subject_test',
      method: 'put',
      data: data
    })
  }

// 删除原料信息管理
export function delmark(data) {
    return request({
      url: '/api/ingredient/subject_test',
      method: 'delete',
      data: data
    })
  }

//getIngredientInfoById
export function getIngredientInfoById(id) {
    return request({
      url: '/api/ingredient?id=' + id,
      method: 'get',
    })
  }

// getIngredientSubjectTestById:{
export function getIngredientSubjectTestById(id) {
        return request({
          url: '/api/getSubjectTestAllByIngredientId?id=' + id,
          method: 'get',
        })
      }

// addSubject
export function addSubject(data) {
  return request({
    url: '/api/subject',
    method: 'post',
    data: data
  })
}

// editSubject
export function editSubject(data) {
  return request({
    url: '/api/subject',
    method: 'put',
    data: data
  })
}

// delProject
export function delProject(data) {
  return request({
    url: '/api/subject',
    method: 'delete',
    data: data
  })
}

// addTest
export function addTest(data) {
  return request({
    url: '/api/test',
    method: 'post',
    data: data
  })
}

// editTest
export function editTest(data) {
  return request({
    url: '/api/test',
    method: 'put',
    data: data
  })
}

// delTest
export function delTest(data) {
  return request({
    url: '/api/test',
    method: 'delete',
    data: data
  })
}

//  copySubjectTestDef: 
export function copySubjectTestDef(id) {
    return request({
      url: '/api/copySubjectTestDef?id=' + id,
      method: 'get',
    })
  }

//  copySubjectDef: 
export function copySubjectDef(id) {
  return request({
    url: '/api/copySubjectDef?id=' + id,
    method: 'get',
  })
}

//testid
export function paramKeyList(id) {
  return request({
    url: '/api/subject/paramKeyList',
    method: 'get',
  })
}

//类别软删除
export function deltestByTs(id,confirm) {
  return request({
    url: '/api/testByTs?id='+id+'&confirm='+confirm,
    method: 'delete',
  })
}

//毒理学终点软删除
export function delsubjectByTs(id,confirm) {
  return request({
    url: '/api/subjectByTs?id='+id+'&confirm='+confirm,
    method: 'delete',
  })
}

// 导入Subject 文献与毒理绑定
export function importSubject(data) {
  return request({
    url: '/api/importSubject',
    method: 'post',
    data: data
  })
}